Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modules foundations #669

Merged
merged 9 commits into from
Nov 10, 2020
Merged

Modules foundations #669

merged 9 commits into from
Nov 10, 2020

Conversation

adrianmroz
Copy link
Collaborator

@adrianmroz adrianmroz commented Oct 22, 2020

No description provided.

Copy link
Member

@mkuthan mkuthan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep going

@@ -261,7 +261,7 @@ export const SETTINGS_MANAGER = new SettingsManager(settingsStore, {
if (PRINT_CONFIG) {
var withComments = Boolean(parsedArgs["with-comments"]);

SETTINGS_MANAGER.getSettings({
SETTINGS_MANAGER.getFreshSettings({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refreshSettings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refreshSettings sound like action with some side effect, but this function is still a getter. Honestly I don't like either option.

}
return Promise.race([task, timeout(timeoutMs)])
.catch(() => {
this.logger.error("Settings load timeout hit, continuing");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error or warn?
put timeout value in the message, will be more descriptive

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!


return currentWork.then(() => this.appSettings);
getSettings(opts: GetSettingsOptions = {}): Promise<AppSettings> {
return this.handleSettingsTask(this.settingsLoaded, opts);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why settingsLoaded is passed as argument if method could access the promise from the object field itself?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in different invocation we pass decorated promise:

return this.handleSettingsTask(task, opts);

@adrianmroz adrianmroz marked this pull request as ready for review November 10, 2020 08:50
@adrianmroz adrianmroz changed the title WIP: modules Modules foundations Nov 10, 2020
@adrianmroz adrianmroz merged commit de8212f into master Nov 10, 2020
@adrianmroz adrianmroz deleted the feature/modules branch November 10, 2020 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants